<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台权限管理</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__ADMIN__css/bootstrap.min.css" rel="stylesheet">
    <link href="__ADMIN__css/font-awesome.min93e3.css" rel="stylesheet">
    <link href="__ADMIN__css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__css/style.min.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/skin/default/layer.css" rel="stylesheet">
    <link src="__ADMIN__js/plugins/layer/laypage/skin/laypage.css">
    <style>
        #tbody img{
            height:70px;
            width:70px;
            border-radius: 50%;
        }
    </style>
</head>
<body>
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>权限管理</h5>
            <div class="ibox-tools">
            </div>
        </div>
        <div class="ibox-content">
                <div class="row m-b-sm m-t-sm">
                    <div class="col-md-2">
                        <a href="{:U('rule/add')}" class="btn btn-outline btn-primary">添加权限</a>
                    </div>
                </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>权限名称</th>
                    <th>权限</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="tbody">
                    <volist name="list" id="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.html}{$vo.title}</td>
                            <td>{$vo.name}</td>
                            <td>
                                <if condition="($vo.status eq 1)">
                                    <a href="javascript:changeMode({$vo.id})" id="mode{$vo.id}" class="btn btn-info btn-outline">正常</a>
                                    <else />
                                    <a href="javascript:changeMode({$vo.id})" id="mode{$vo.id}" class="btn btn-warning btn-outline">禁用</a>
                                </if>
                            </td>
                            <td>
                                <a href="{:U('rule/add?pid='.$vo['id'])}" type="button" class="btn btn-outline btn-info"><i class="fa fa-plus-square-o"></i>添加子权限</a>
                                <a href="{:U('rule/edit?id='.$vo['id'])}" type="button" class="btn btn-outline btn-info"><i class="fa fa-pencil-square-o"></i>修改</a>
                                <a href="javascript:Del({$vo.id})" class="btn btn-outline btn-danger"><i class="fa fa-trash-o"></i>删除</a>
                            </td>
                        </tr>

                    </volist>
                </tbody>
            </table>


        </div>
    </div>
</div>
<script src="__ADMIN__js/jquery.min.js"></script>
<script src="__ADMIN__js/plugins/layer/layer.min.js"></script>
<script src="__ADMIN__js/plugins/layer/laypage/laypage.js"></script>
<script src="__ADMIN__js/common.js"></script>
</body>
<script>
    function changeMode(id){
        var mode = $("#mode"+id);
        common.status("{:U('rule/changeMode')}",id,mode);
    }
    function Del(id){
        layer.msg('你确定要删除吗？', {
            time: 0 //不自动关闭
            ,btn: ['必须啊', '放你一马']
            ,yes: function(index){
                common.del("{:U('rule/Del')}",id,'/admin/rule/index');
            }
        });

    }
</script>
</html>
